class Solution {
public:
    int row[10][10];
    int col[10][10];
    int pane[3][3][10];
    bool isValidSudoku(vector<vector<char>>& board)
    {
        for (int i = 0; i < 9; i++)
        {
            for (int j = 0; j < 9; j++)
            {
                if (board[i][j] != '.')
                {
                    int x = board[i][j] - '0';
                    if (row[i][x] || col[j][x] || pane[i / 3][j / 3][x]) return false;
                    row[i][x] = col[j][x] = pane[i / 3][j / 3][x] = 1;
                }
            }
        }
        return true;
    }
};